package com.gxa.service.impl;

import com.gxa.mapper.RoleMapper;
import com.gxa.pojo.Permission;
import com.gxa.pojo.Role;
import com.gxa.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    RoleMapper roleMapper;

    @Override
    public List<Role> selectRoleAll() {
        return roleMapper.selectRoleAll();
    }

    @Override
    public List<Role> selectRollByUserId(Map map) {
        return roleMapper.selectRollByUserId(map);
    }

    @Override
    public List<Role> selectRoleByPage(Integer page, Integer size) {
        return roleMapper.selectRoleByPage(page, size);
    }

    @Override
    public Integer selectAllRole() {
        return roleMapper.selectAllRole();
    }

    @Override
    public Integer insertRole(Map map) {
        return roleMapper.insertRole(map);
    }

    @Override
    public Integer deleteRole(Map map) {
        return roleMapper.deleteRole(map);
    }

    @Override
    public Integer updateRole(Map map) {
        return roleMapper.updateRole(map);
    }

    @Override
    public Integer insertUserRole(Map map) {
        return roleMapper.insertUserRole(map);
    }

    @Override
    public Integer deleteRoleUser(Integer id) {
        return roleMapper.deleteRoleUser(id);
    }

    @Override
    public List<Permission> findPermissionByRoleId(Integer id) {
        return roleMapper.findPermissionByRoleId(id);
    }

    @Override
    public Integer updateRoleState(Map map) {
        return roleMapper.updateRoleState(map);
    }
}